package io.gitee.sfch.chunmi.code.generator.conf;

import io.gitee.sfch.chunmi.code.generator.entity.ColumnRef;
import io.gitee.sfch.chunmi.code.generator.filter.CurdEntityColumnRefFilter;
import io.gitee.sfch.chunmi.code.generator.filter.TenantCurdEntityColumnRefFilter;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.function.Predicate;

/**
 * 实体类型
 */
@Getter
@AllArgsConstructor
public enum EntityTypeEnum {

    /**
     * 一般，无继承
     */
    simple(null, null, null),

    /**
     * 继承于CurdEntity的增删改查实体
     */
    curdEntity("CurdEntity", "io.gitee.sfch.chunmi.common.entity.CurdEntity", new CurdEntityColumnRefFilter()),

    /**
     * 继承于TenantCurdEntity的租户增删改查实体
     */
    tenantCurdEntity("TenantCurdEntity", "io.gitee.sfch.chunmi.common.entity.TenantCurdEntity", new TenantCurdEntityColumnRefFilter()),
    ;

    /**
     * 上级类
     */
    private final String superClass;

    /**
     * 类所在的包路径
     */
    private final String classPackage;

    /**
     * 字段过滤器
     */
    private final Predicate<ColumnRef> columnRefFilter;
}
